﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;

namespace ClassLibrary6
{
    public class LoginPage : Page
    {
        public LoginPage(IWebDriver driver)
        {
            base.driver = driver;
        }

        public LoginPage open()
        {
            driver.Navigate().GoToUrl("http://demo.bananascrum.com/login");
            return new LoginPage(driver);
        }

        public BacklogPage signIn()
        {
            String login = "admin";
            String password = "password";
            IWebElement loginField = driver.FindElement(By.Name("login"));
            IWebElement passwordField = driver.FindElement(By.Name("password"));
            IWebElement submit = driver.FindElement(By.Name("commit"));

            loginField.SendKeys(login);
            passwordField.SendKeys(password);
            submit.Click();
                    
            return new BacklogPage(driver);
        }
    }
}
